package com.supplychainapi.service;

import com.github.pagehelper.PageInfo;
import com.joindata.inf.common.basic.exceptions.ServiceException;
import com.supplychainapi.model.ScmTbstorage;
import com.supplychainapi.model.ScmTbstorageExtend;
import com.supplychainapi.param.ColTitle;

import java.util.List;

/**
 * 手机版仓库
 *
 * @author:xiezhiwei
 * @email:xiezhiwei@niwodai.net
 * @date:2017-10-11
 */
public interface IScmTbstorageService {

    /**
     * 新增仓库信息
     *
     * @param storage
     */
    void addScmTbstorageInfo(ScmTbstorage storage) throws ServiceException;

    /**
     * 查询仓库列表
     *
     * @param fsShopGUID    店铺GUID
     * @param fsStorageName 仓库名称
     * @param page          当前页
     * @param pageSize      数据大小
     * @return
     * @throws ServiceException
     */
    PageInfo getScmTbstorageListInfo(String fsShopGUID, String fsStorageName, Integer pageNum, Integer pageSize) throws ServiceException;

    /**
     * 查询仓库列表
     *
     * @param fsShopGUID 店铺GUID
     * @param page       当前页
     * @param pageSize   数据大小
     * @return
     * @throws ServiceException
     */
    List<ScmTbstorage> getScmTbstorageListInfo(String fsShopGUID, Integer page, Integer pageSize) throws ServiceException;

    /**
     * 根据代码名称模糊查询
     *
     * @param fsShopGUID    店铺GUID
     * @param fsStorageName 仓库名称
     * @return
     * @throws ServiceException
     */
    List<ScmTbstorage> getScmTbstorageLikeListInfo(String fsShopGUID, String fsStorageName, Integer page, Integer pageSize) throws ServiceException;

    /**
     * 根据仓库代码和店铺GUID查询
     *
     * @param fsShopGUID  店铺GUID
     * @param fsStorageId 仓库代码
     * @return
     * @throws ServiceException
     */
    ScmTbstorage getScmTbstorageByFsShopGUIDAndFsStorageIdInfo(String fsShopGUID, String fsStorageId) throws ServiceException;

    /**
     * 根据当前门店和仓库名称判断重复
     *
     * @param fsShopGUID
     * @param fsStorageName
     * @param fsStorageId
     * @param type
     * @return
     */
    Boolean getStorageDeDuplication(String fsShopGUID, String fsStorageName, String fsStorageId, String type) throws ServiceException;

    /**
     * 删除仓库信息
     *
     * @param fsShopGUID
     * @param fsStorageId
     * @throws ServiceException
     */
    void deleteStorageInfo(String fsShopGUID, String fsStorageId) throws ServiceException;

    /**
     * 更新仓库信息
     *
     * @param storage
     * @throws ServiceException
     */
    void updateStorageInfo(ScmTbstorage storage) throws ServiceException;

    /**
     * 统计仓库数量
     *
     * @param param
     * @return
     */
    int count(ScmTbstorage param);

    /**
     * 选择仓库信息
     *
     * @param fsShopGUID    门店GUID
     * @param fsStorageName 仓库名称
     * @return
     */
    PageInfo getChoiceStorageListInfo(String fsShopGUID, String fsStorageName, Integer pageNum, Integer pageSize) throws ServiceException;


    /**
     * 标题
     *
     * @return
     */
    List<ColTitle> getSchema();

    /**
     * 选取仓库标题
     *
     * @return
     */
    List<ColTitle> getChoiceSchema();

    /**
     * 获取编辑扩展详情
     *
     * @param fsShopGUID
     * @param fsStorageId
     * @return
     */
    ScmTbstorageExtend getStorageExtendInfo(String fsShopGUID, String fsStorageId) throws ServiceException;


}
